#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 300
#define mod 1000000007
using namespace std;
int read()
{
	char c=0;
	int sum=0;
	while (c<'0'||c>'9') c=getchar();
	while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
	return sum;
}
int n,ans,s[N+1];
char c[N+1],cs[N+1];
bool check()
{
	bool op=1;
	int rst=0;
	for (int i=1;i<=n;++i) rst+=((c[i]=='(')?1:-1),op&=(rst>=0);
	op&=(!rst);
	if (op) return 1;
	for (int i=1;i<=n;++i)
		for (int j=i;j<=n;++j)
		{
			rst=0,op=1;
			for (int k=1;k<=n;++k) rst+=(((c[k]=='(')^(i<=k&&k<=j))?1:-1),op&=(rst>=0);
			op&=(!rst);
			if (op) return 1;
		}
	return 0;
}
bool check2()
{
	int rst=0,l=-1,r=-1,sr=0,sr2=0,maxn=0;
	for (int i=1;i<=n;++i) cs[i]=c[i];
	for (int i=1;i<=n;++i) rst+=((cs[i]=='(')?1:-1);
	if (rst<0)
	{
		reverse(cs+1,cs+n+1);
		for (int i=1;i<=n;++i) cs[i]^=('('^')');
	}
	for (int i=1;i<=n;++i) s[i]=s[i-1]+((cs[i]=='(')?1:-1);
	for (int i=1;i<=n;++i)
		if (s[i]<0)
		{
			l=i-1;
			break;
		}
	for (int i=n-1;i>=0;--i)
		if (s[i]<s[n])
		{
			r=i+1;
			break;
		}
	if (l==-1)
	{
		for (int i=r;i<=n;++i) sr=max(sr,s[i]-(s[n]>>1));
		for (int i=r-1;i>=0;--i)
		{
			if (s[i]==sr) return 1;
			if (s[i]>(sr<<1)) return 0;
		}
		return 1;
	}
	for (int i=0;i<=l;++i) sr=max(sr,s[i]);
	for (int i=r;i<=n;++i) sr2=max(sr2,s[i]-(s[n]>>1));
	for (int i=l;i<=r;++i) maxn=max(maxn,s[i]);
	return maxn<=(min(sr,sr2)<<1);
}
void dfs(int x)
{
	if (x==n+1)
	{
		ans+=check2();
		return;
	}
	c[x]='(',dfs(x+1);
	c[x]=')',dfs(x+1);
	return;
}
int main()
{
	n=read(),dfs(1),printf("%d\n",ans);
	return 0;
}
